Xbasic

Xbasic COMMENT

Syntax

'

Description

You can add comments to Xbasic by starting a line with an apostrophe.

Discussion

An apostrophe placed at the beginning of a line of code will designate that line of code as a comment. When the machine reads the program it will then ignore any commented lines included in the code. This can be useful when adding text to a program that specifies the function of a line or block of code. It is also useful for commenting out lines of code that you want to skip. Example:

'All of this text and the Xbasic will be skipped
'dim field_value as D
'delete field_value

Commenting out Blocks of Xbasic

There are no 'start' and 'end' comment tags in Xbasic that allow you to comment out large areas of code with a few tags as you would in Javascript. However, most of the Xbasic editors in Alpha Anywhere allow you to comment out multiple lines of code at once. This is done by first selecting the lines of code that you want to add or remove comments from, and then clicking buttons on the toolbar. To add multiple comments:

  1. Highlight the code to comment out

    images/comment.png
  2. Click the comment out button

    images/comment2.png
  3. Result

    images/comment3.png

To remove the apostrophes from comments and include lines back into the code:

  1. Highlight the code to un-comment out.

    images/comment4.png
  2. Click the 'Un-Comment Out' button

    images/comment5.png
  3. Result

    images/comment6.png

See Also